<div id="left-col">
    <div class="wrap">
        <div class="container">
            <div class="inside">
                
            </div>
        </div>
    </div>
</div>

<div id="right-col">

    <div class="wrap">
        <div class="container">

            
            <div id="breadcrumb" style="display:none;"><span style="padding-left:10px;font-size:10px;color:#777777;" id="alsoviewing"></span></div>
            <div class="inside">
                <h1>Dash board</h1>
				<br/>
				<div id="search" style="width:45%;">
					<fieldset style="border: 1px solid #DDDDDD; border-radius: 7px 7px 7px 7px; margin: 0 0 10px; padding: 8px;">
						<legend style="padding:1px;">&nbsp;Quick Search </legend>
				        <div class="row" style="padding:10px;">
							<?php echo CHtml::textField('entityId','',array('size'=>30,'maxlength'=>75)); ?>
							<?php echo CHtml::dropDownList('entityName','',
												array("job" => "Job", 
													  "invoices" => "Invoice/Sales Order/Quotation",
													  "contract" => "Contract"
													  ),
												array("prompt" => "Please Select")
													
											);
							?>
							<?php echo CHtml::button("Go", array("id"=>"searchGo"))?>
											
						</div>
					</fieldset>
				</div>
                
            </div><!-- inside -->
        </div><!-- container -->
    </div><!-- wrap -->

</div> <!-- left-col -->
<?php
Yii::app()->clientScript->registerScript('search',"
$('#searchGo').click(function(){
	var entityName = $('#entityName option:selected').val();
	var entityId = $('#entityId').val();
	$.get('?r=salespersonportal/ajax/entitySearch',
		{
			entityName : entityName,
			entityId : entityId
		},
	 	function(resp,status) {
			if(resp.success) {	
				window.location.href = resp.url;
			} else {
				alert(resp.errorMsg);
			}
		},
		'json'
	);
});
");
?>
